package cz.muni.fi.pb162.project.geometry;


/**
 * Write a description of class Circle here.
 * 
 * @author Martin Pasko
 * @version 2012-10-01 project02
 */
public class Circle extends GeneralRegularPolygon implements Solid
{
    
    private double radius;
    
/**
 * Creates a circle by calling super constructor
 * 
 * @param center center of the circle
 * @param radius radius of the circle
*/
    
    public Circle(Vertex2D center, double radius){
        super(center, Integer.MAX_VALUE, 0);
        this.radius = radius;
    }

/**
 * Calls the parametric constructor of Circle class with x=0, y=0 parameters of the centre and 1 radius
 * 
*/

    public Circle(){
        this(new Vertex2D(0.0, 0.0), 1);
    }
    
    
   public double getRadius(){
        return radius;
    }
    
/**
 * Computes perimeter of the circle.
 * @return perimeter
*/

   public double getLength() {
        return 2*Math.PI*getRadius();
   }  
   
/**
 * Computes area of the circle.
 * @return parea
*/

   public double getArea() {
        return Math.PI*Math.pow(getRadius(), 2);
   }
   
/**
 * Circle toString method
 * 
 * @return returns center and radius of the circle
*/

    @Override 
    public String toString(){
        return "Circle: center="+getCenter()+", radius="+radius;
    }
}